/**
 * 
 */

/**
 * @author pratikbhavsar
 * 
 */
public class ColorPoint extends Point {

	String color;

	public ColorPoint(String name, double x, double y, String color) {
		super(name, x, y);
		this.color = color;
	}

	public String getColour() {
		return color;
	}

	public void setColour(String colour) {
		this.color = colour;
	}

	@Override
	public String toString() {
		return "ColorPoint " +color + " (" + x + "," + y + ")";
	}

	public static Object deserialize(String s) 
	{
		java.util.StringTokenizer objectString = new java.util.StringTokenizer(
				s, ";");
		objectString.nextToken();
		String field = "";
		java.util.StringTokenizer fieldString = null;
		field = objectString.nextToken();
		fieldString = new java.util.StringTokenizer(field, ":");
		Dispatcher dispatcher = new Dispatcher();
		fieldString.nextToken();
		field = fieldString.nextToken();
		String _name = fieldString.nextToken();
		field = objectString.nextToken();
		fieldString = new java.util.StringTokenizer(field, ":");
		fieldString.nextToken();
		double _x = Double.parseDouble(fieldString.nextToken());
		field = objectString.nextToken();
		fieldString = new java.util.StringTokenizer(field, ":");
		fieldString.nextToken();
		double _y = Double.parseDouble(fieldString.nextToken());
		field = objectString.nextToken();
		fieldString = new java.util.StringTokenizer(field, ":");
		fieldString.nextToken();
		fieldString.nextToken();
		String _color = fieldString.nextToken();
		return new ColorPoint(_name, _x, _y, _color);
	}
}
